//
//  MIDIlactiviViewCell.m
//  迷笛
//
//  Created by . on 2018/9/10.
//  Copyright © 2018年 🍃🌺🌺🍃. All rights reserved.
//

#import "MIDIlactiviViewCell.h"

@implementation MIDIlactiviViewCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        [self addSubview:self.backview];
        [self.backview mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self);
            make.centerY.equalTo(self);
            make.width.mas_equalTo(WidthScale(344));
            make.height.mas_equalTo(kDevice_Is_iPhoneX?HeighX(250):HeightScale(220));
        }];
        [self.backview addSubview:self.maniniamge];
        [self.maniniamge mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(0);
            //            make.left.mas_equalTo(0);
            make.centerX.equalTo(self);
            make.width.mas_equalTo(self.backview);
            make.height.mas_equalTo(kDevice_Is_iPhoneX?HeighX(150):HeightScale(150));
        }];
        
        [self.backview addSubview:self.address];
        [self.address mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(WidthScale(10));
            make.top.equalTo(self.maniniamge.mas_bottom).offset(WidthScale(10));
            make.width.mas_equalTo(WidthScale(330));
            make.height.mas_equalTo(kDevice_Is_iPhoneX?HeightScale(17):HeighX(17));
        }];
        [self.backview addSubview:self.day];
        [self.day mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.address.mas_bottom).offset(WidthScale(5));
            make.left.equalTo(self.address);
            [self.day setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        
        [self.backview addSubview:self.coordinatesiamge];
        [self.coordinatesiamge mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.day.mas_bottom).offset(WidthScale(5));
            make.left.equalTo(self.address);
            make.width.mas_equalTo(WidthScale(15));
            make.height.mas_equalTo(HeightScale(kDevice_Is_iPhoneX?HeighX(15):HeightScale(15)));
        }];
        [self.backview addSubview:self.coordinates];
        [self.coordinates mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.day.mas_bottom).offset(WidthScale(5));
            make.left.equalTo(self.coordinatesiamge.mas_right).offset(WidthScale(5));
            [self.coordinates setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
            
        }];
        
        
        [self.backview addSubview:self.timeiamge];
        [self.timeiamge mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.day.mas_bottom).offset(WidthScale(5));
            make.left.equalTo(self.coordinates.mas_right).offset(WidthScale(10));
            make.width.mas_equalTo(WidthScale(15));
            make.height.mas_equalTo(HeightScale(kDevice_Is_iPhoneX?HeighX(15):HeightScale(15)));
        }];
        [self.backview addSubview:self.time];
        [self.time mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.day.mas_bottom).offset(WidthScale(5));
            make.left.equalTo(self.timeiamge.mas_right).offset(WidthScale(5));
            [self.time setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
            
        }];
        
        
    }
    return self;
}
-(UIView *)backview
{
    if (!_backview)
    {
        _backview =[[UIView alloc]init];
        _backview.backgroundColor=[UIColor colorWithHexString:@"#1B212F"];
        //        _backview.backgroundColor=[UIColor orangeColor];
        
        //v.layer.masksToBounds=YES;这行去掉
        _backview.layer.cornerRadius=10;
        _backview.layer.shadowColor=[UIColor blackColor].CGColor;
        _backview.layer.shadowOffset=CGSizeMake(5, 5);
        _backview.layer.shadowOpacity=0.5;
        _backview.layer.shadowRadius=5;
    }
    return _backview;
}
-(UIImageView *)maniniamge
{
    if (!_maniniamge)
    {
        _maniniamge =[[UIImageView alloc]init];
        _maniniamge.layer.cornerRadius=10;
        _maniniamge.layer.masksToBounds=YES;
        
        
    }
    return _maniniamge;
}
-(UILabel *)address
{
    if (!_address)
    {
        _address =[[UILabel alloc]init];
        _address.textColor = [UIColor colorWithHexString:@"#FFFFFF"];
        //        _address.backgroundColor = [UIColor colorWithHexString:@"#1B212F"];
        _address.font =[UIFont systemFontOfSize:WidthScale(15)];
    }
    return _address;
}
-(UIImageView *)coordinatesiamge
{
    if (!_coordinatesiamge)
    {
        _coordinatesiamge =[[UIImageView alloc]init];
        _coordinatesiamge.image = [UIImage imageNamed:@"location"];
    }
    return _coordinatesiamge;
}
-(UILabel *)coordinates
{
    if (!_coordinates)
    {
        _coordinates =[[UILabel alloc]init];
        _coordinates.font =[UIFont systemFontOfSize:WidthScale(12)];
        _coordinates.textColor =[UIColor whiteColor];
    }
    return _coordinates;
}
-(UIImageView *)timeiamge
{
    if (!_timeiamge)
    {
        _timeiamge =[[UIImageView alloc]init];
        _timeiamge.image = [UIImage imageNamed:@"time"];
    }
    return _timeiamge;
}
-(UILabel *)time
{
    if (!_time)
    {
        _time =[[UILabel alloc]init];
        _time.font =[UIFont systemFontOfSize:WidthScale(12)];
        _time.textColor =[UIColor whiteColor];
    }
    return _time;
}
-(UILabel *)day
{
    if (!_day)
    {
        _day =[[UILabel alloc]init];
        _day.textColor =[UIColor colorWithHexString:@"#FF005D"];
        _day.font = [UIFont systemFontOfSize:WidthScale(14)];
    }
    return _day;
}
@end
